import fetch from "@/utils/fetch";
/********************微信***************************/
//微信获取签名
export function getSignature(data) {
    return fetch({
        url: "/api/weixin/getSignature",
        method: "get",
        params: data
    });
}
//获取AccessToken
export function getAccessToken(data) {
  return fetch({
      url: "/api/weixin/getAccessToken",
      method: "get",
      params: data
  });
}



/******************登陆**************************/
// 授权
export function getToken(data) {
    return fetch({
        url: "/api/auth/login",
        method: "post",
        params: data
    });
}
// 获取验证码
export function getVerificationCode(data) {
    return fetch({
        url: "/api/Users/getVerificationCode",
        method: "get",
        params: data
    });
}
// 登陆
export function login(data) {
    return fetch({
        url: "/api/Users/login",
        method: "post",
        params: data
    });
}
// 获取首页信息
export function getActivityInfo(data) {
    return fetch({
        url: "/api/Home/getInfo",
        method: "get",
        params: data
    });
}
// 海选阶段获取用户信息,成绩，排名以及期,阶段信息
export function getUserInfo(data) {
    return fetch({
        url: "/api/Home/getUserInfo",
        method: "post",
        params: data
    });
}


/******************诗王争霸期管理**************************/
// 按照期编号查询诗王争霸期信息--通用
export function getFutureInfoById(data) {
    return fetch({
        url: "/api/Future/getInfoById",
        method: "get",
        params: data
    });
}


/******************诗王争霸阶段信息**************************/
// 按照阶段号查询阶段信息--通用
export function getInfoById(data) {
    return fetch({
        url: "/api/Stages/getInfoById",
        method: "post",
        params: data
    });
}
// 按照阶段号查询阶段信息--通用
export function getByFutureStagesId(data) {
    return fetch({
        url: "/api/Stages/getByFutureStagesId",
        method: "get",
        params: data
    });
}

/******************报名**************************/
// 活动报名
export function AddEnroll(data) {
    return fetch({
        url: "/api/Enroll/addEnroll",
        method: "post",
        params: data
    });
}
// 用期号用户编号查看是报名 0未报名 1已经报名
export function CheckUserId(data) {
    return fetch({
        url: "/api/Enroll/CheckUserId",
        method: "post",
        params: data
    });
}
// 按照班级编号获取报名信息列表
export function getEnrollListByCLassId(data) {
    return fetch({
        url: "/api/Enroll/getEnrollListByCLassId",
        method: "post",
        params: data
    });
}
// 获取用户的报名总数量
export function getEnrollNum(data) {
    return fetch({
        url: "/api/Enroll/getEnrollNum",
        method: "get",
        params: data
    });
}
//获取栏目的背景图片和每个栏目的参与人数--前端
export function getColumnInfo(data) {
    return fetch({
        url: "/api/Enroll/getColumnInfo",
        method: "post",
        params: data
    });
}

/******************统计****************************/ 
//获取班级用户飞花令胜率信息
export function getAnswerIngScoreByClass(data){
    return fetch({
        url: "/api/PK/getAnswerIngScoreByClass",
        method: "get",
        params: data
    });
}

/******************飞花令**************************/
// 获取主题难度列表
export function getThemeTypeList(data) {
    return fetch({
        url: "/api/Game/getThemeTypeList",
        method: "get",
        params: data
    });
}
// 获取主题列表
export function getThemeList(data) {
    return fetch({
        url: "/api/Game/getThemeList",
        method: "get",
        params: data
    });
}
// 创建用户房间
export function CreateRoom(data) {
    return fetch({
        url: "/api/Game/createRoom",
        method: "post",
        params: data
    });
}
// 创建房间结果信息
export function createRoomResult(data) {
    return fetch({
        url: "/api/Game/createRoomResult",
        method: "post",
        params: data
    });
}
// 获取机器人答题列表
export function getRobotMsgList(data) {
  return fetch({
      url: "/api/Game/getRobotMsgList",
      method: "get",
      params: data
  });
}

// ```````实时通讯``````````
// 获取token
export function socketLogin(data) {
    let socketUrl = process.env.BASE_API_Socket?process.env.BASE_API_Socket:''
    return fetch({
        baseURL: socketUrl,
        url: "/api/v1/auth/login",
        method: "post",
        headers: {
            'ClientType': 1
        },
        data: data
    });
}

/******************活动首页**************************/
//获取班级成绩排行榜
export function GetClassRanking(data) {
    return fetch({
        url: "/api/Home/getClassRanking",
        method: "get",
        params: data
    });
}
//获取班级成绩排行
export function GetMyClassRanking(data) {
    return fetch({
        url: "/api/Home/getMyClassRanking",
        method: "get",
        params: data
    });
}
//获取用户成绩排行榜
export function GetUserRanking(data) {
    return fetch({
        url: "/api/Home/getUserRanking",
        method: "get",
        params: data
    });
}
//获取用户成绩排行
export function GetMyRanking(data) {
    return fetch({
        url: "/api/Home/getMyRanking",
        method: "get",
        params: data
    });
}
//获取班内成绩排行榜
export function GetUserRankingByClass(data) {
    return fetch({
        url: "/api/Home/getUserRankingByClass",
        method: "get",
        params: data
    });
}

/******************古诗词背诵**************************/
//提交录音获取评价

export function addUserRead(data) {
    return fetch({
        url: "/api/chineseRead/addUserRead",
        method: "post",
        data: data
    });
}

//获取标红信息
export function readNewLogNewPage(data) {
  return fetch({
    url: "/api/NewRead/readNewLogNewPage",
    method: "post",
    params: data
  });
}



//统计班级用户诗词平均分
export function getPoetryAverageScoreByClass(data){
    return fetch({
        url:"/api/chineseRead/getPoetryAverageScoreByClass",
        method:"get",
        params:data
    });
}
//获取班级用户诗词得分信息
export function getPoetryScoreDetailByClass(data){
    return fetch({
        url: "/api/chineseRead/getPoetryScoreDetailByClass",
        method:"get",
        params:data
    });
}

//分页获取古诗词列表
export function bookPoetryPage(data) {
  return fetch({
    url: "/api/chineseRead/bookPoetryPage",
    method: "get",
    params: data
  });
}

//获取诗词信息
export function getBookPoetryInfo(data) {
  return fetch({
    url: "/api/chineseRead/getBookPoetryInfo",
    method: "get",
    params: data
  });
}

//获取经典背诵实体

export function getPoetryIndexInfo(data) {
  return fetch({
    url: "/api/chineseRead/getPoetryUserStatistics",
    method: "get",
    params: data
  });
}
//获取经典背诵实体

export function getPoetryUserStatistics(data) {
    return fetch({
      url: "/api/chineseRead/getPoetryUserStatistics",
      method: "get",
      params: data
    });
  }


//老师评论
export function TeacherContent(data) {
  return fetch({
    url: "/api/chineseRead/UpdatePoetryUserStatisticsTeacherContents",
    method: "post",
    params: data
  });
}


//老师点赞
export function TeacherPraise(data) {
  return fetch({
    url: "/api/chineseRead/UpdatePoetryUserStatisticsTeacherPraise",
    method: "post",
    params: data
  });
}

//老师评论和点赞

export function TeacherPraiseAndContent(data) {
  return fetch({
    url: "/api/chineseRead/UpdateTeacherPraiseAndTeacherContents",
    method: "post",
    data: data
  });
}








/******************智力大比拼**************************/
//获取房间目录--前台
export function GetRoomList(data) {
    return fetch({
        url: "/api/PK/GetRoomList",
        method: "post",
        params: data
    });
}

//获取机器人接口随机三个机器人--前台
export function getRobotListRandom(data) {
  return fetch({
    url: "/api/PK/GetRobotListRandom",
    method: "get",
    params: data
  });
}
//取得题目id组--前台
export function getQuestionIds(data) {
  return fetch({
    url: "/api/PK/GetQuestionIds",
    method: "post",
    params: data
  });
}
//新增PK积分--前台
export function addScore(data) {
  return fetch({
    url: "/api/PK/AddScore",
    method: "post",
    params: data
  });
}
//统计班级用户诗词竞彩平均分
export function getRoomAverageScoreByClass(data) {
    return fetch({
      url: "/api/PK/getRoomAverageScoreByClass",
      method: "get",
      params: data
    });
}
//获取班级用户诗词竞答得分信息
export function getRoomScoreDetailByClass(data) {
    return fetch({
        url: "/api/PK/getRoomScoreDetailByClass",
        method: "get",
        params: data
    });
}

/******************诗王争霸景点管理**************************/
//上传图片
export function uploadImg(data) {
  return fetch({
    url: "/api/File/importFile",
    method: "post",
    data: data
  });
}
//获取诗词打卡列表
export function getListViewByUser(data) {
  return fetch({
    url: "/api/Scenic/getListByFutureIdAndUserId",
    method: "get",
    params: data
  });
}
//按照编号景点具体信息
export function getScenicInfoById(data) {
  return fetch({
    url: "/api/Scenic/getInfoById",
    method: "get",
    params: data
  });
}

//景点打卡
export function addScenicUser(data) {
  return fetch({
    url: "/api/ScenicUser/addScenicUser",
    method: "post",
    data: data
  });
}

//删除打卡
export function deleteScenicUser(data) {
  return fetch({
    url: "/api/ScenicUser/deleteScenicUser",
    method: "post",
    data: data
  });
}

//获取班级列表
export function getListByUserId(data) {
  return fetch({
    url: "/api/UserClass/getListByUserId",
    method: "get",
    params: data
  });
}

//老师获取景点打卡列表

export function getListByFutureIdAndClassId(data) {
  return fetch({
    url: "/api/Scenic/getListByFutureIdAndClassId",
    method: "get",
    params: data
  });
}

//二级列表
export function getListByScenicId(data) {
  return fetch({
    url: "/api/Scenic/getListByFutureIdAndClassIdAndScenicId",
    method: "get",
    params: data
  });
}

//获取学生打卡信息
export function getByScenicUserId(data) {
  return fetch({
    url: "/api/ScenicUser/getByScenicUserId",
    method: "get",
    params: data
  });
}

//老师点赞学生景点作品
export function teacherPraise(data) {
  return fetch({
    url: "/api/ScenicUser/updateScenicUserTeacherPraise",
    method: "post",
    params: data
  });
}

//老师审核景点作品
export function teacherCheck(data) {
  return fetch({
    url: "/api/ScenicUser/updateScenicUserCheckAll",
    method: "post",
    data: data
  });
}
